package com.gwcloud.coffeeman.example.beans;

import com.gwcloud.coffeeman.common.utils.LogWriter;
import com.gwcloud.coffeeman.example.utils.TestComponentWrapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @ClassName: TestComponent
 * @author:    ganwei
 * @Date:      2020-09-10
 * @Desc:      程序描述
 */

@Component
public class TestComponent {
    private String name;

    public TestComponent(){
        LogWriter.trace(getClass(),"构造函数初始化bean");
        this.name = "ganwei";
    }

    @PostConstruct
    public void init(){
        LogWriter.trace(getClass(),"init初始化bean,赋值给静态工具类");
        TestComponentWrapper.testbean = this;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
